<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title>服装款式</title>
    <%@ include file="/WEB-INF/views/include/head.jsp"%>
    <script src="${ctxStatic}/js/jquery-1.9.1.min.js"></script>
    <script src="${ctxStatic}/js/DateTimePicker.js"></script>
    <script src="${ctxStatic}/js/layer.js"></script>
    <script src="${ctxStatic}/js/style.js"></script>
   	<script src="${ctxStatic}/dateCalendar/WdatePicker.js"></script>
    <link rel="stylesheet" href="${ctxStatic}/css/common_erp.css">
    <link rel="stylesheet" href="${ctxStatic}/css/list.css">
    <script>
    $(document).ready(function() {
        $(window.parent.$('#dtBox1')).DateTimePicker(
                {
                    dateFormat: "yyyy-MM-dd HH:mm",
                    parentElement: ".timeBox",
                }
        );

    });
	
        //检索 
    function searchListForm() {
    	var params = $("#searchForm").serialize();
    	$("#activity_pane").showLoading();
		$.post("${ctx}/produce/loss/searchList",params, function(result) {
			var listHtml = result["produceLoss"];
			var pageHtml = result["page"];
			$("#listHtml").html(listHtml);
			$("#paging").html(pageHtml);
			$("#activity_pane").hideLoading();
		}, 'json');
	}
        
    // 导出数据 
    function exportData(){
		$("#activity_pane").showLoading();
		var params = $("#searchForm").serialize();
		$.post('${ctx}/produce/loss/exportFile',params, function(result) {
			if (result == "true") {
				window.location.href='${ctx}/produce/loss/makeExportFile';
			}else {
				tipParent(result.message);
			}
			$("#activity_pane").hideLoading();
		}, 'json');
    }
        
	//重置
	function clean() {
		$("input").val("");
		searchListForm();
	}   
    </script>
</head>
<body>
<form id="searchForm">
<div class="listArea" id="activity_pane">
	<div class="listBg">
        <div class="searchArea clearfix">
            <div class="searchLeft clearfix">
                <div class="searchInp clearfix">
                <!-- 合同号  -->
                    <p>合同号</p>
                    <input class="w-styleNub" name="contractNo" value="">
                </div>
                <div class="searchInp clearfix">
                <!-- 订单号  -->
                    <p>订单号</p>
                    <input class="w-styleNub" name="orderNo" value="">
                </div>
                <div class="searchInp clearfix">
                <!-- 生产号  -->
                    <p>生产号</p>
                    <input class="w-styleNub" name="styleNo" value="">
                </div>
                <div class="searchInp clearfix">
                <!-- 物料名称 -->
                    <p>物料名称</p>
                    <input class="w-styleNub" name="materialCode" value="">
                </div>
                <div class="searchInp clearfix">
                <!-- 日期  -->
                    <p><spring:message code="purchase_contract_date" /></p>
                    <div class="timeBox">
							<input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})"
								id="dateStart" name="dateStart" style="width: 110px">
							<p class="list">~</p>
							<input type="text" class="laydate-icon" onclick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd',onpicked:null})" id="dateEnd" name="dateEnd"
								style="width: 110px" >
                    </div>        
                </div>               
            </div>
            <div class="searchRight clearfix">
            	<button type="button" onclick="exportData();">导出</button>
                <button type="button" onclick="searchListForm();"><spring:message code="commom_check" /></button>
                <button type="button" onclick="clean();"><spring:message code="common_reset" /></button>
            </div>
        </div>
        <div class="tableArea">
            <div class="tableScrollSm" style = "height:700px;overflow: auto;width: 1127px;">
                <table cellpadding="0" class="tableHead">
                    <thead>
                    <tr>
                        <th><p class="table-No"><spring:message code="common_no" /></p></th>
                        <th><p class="width-150px">合同号</p></th>
                        <th><p class="width-150px">订单号</p></th>
                        <th><p class="width-150px">生产号</p></th>
                        <th><p class="width-150px">物料名称</p></th>
                        <th><p class="width-150px">换片数量</p></th>
                        <th><p class="width-150px">创建人</p></th>
                        <th><p class="width-150px">创建日期</p></th>
                    </tr>
                    </thead>
                </table>
                <table cellpadding="0" class="tableBody">
                    <tbody id="listHtml">
                    </tbody>
                </table>
            </div>            
        </div>
    </div>
    <div id = "paging" ></div>
   
<script type="text/javascript">
$(document).ready(function(){
	searchListForm();
	
	});

</script> 
</div>
</form>
</body>
</html>
